package com.seewo.dubbo.debugger.api;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

/**
 * @author chenliangliang
 * @date 2018/7/26
 */

public class Request implements Serializable {

    private static final long serialVersionUID = 1949288001806843191L;

    private String interfaceName;
    private String methodName;
    private List<Arg> args = new ArrayList<>();

    public String getInterfaceName() {
        return interfaceName;
    }

    public void setInterfaceName(String interfaceName) {
        this.interfaceName = interfaceName;
    }

    public String getMethodName() {
        return methodName;
    }

    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }

    public void addArg(Arg arg) {
        this.args.add(arg);
    }

    public void addArgs(Collection<Arg> args) {
        this.args.addAll(args);
    }

    public List<Arg> getArgs() {
        return new ArrayList<>(args);
    }

    @Override
    public String toString() {
        return "Request{" +
                "interfaceName='" + interfaceName + '\'' +
                ", methodName='" + methodName + '\'' +
                ", args=" + args +
                '}';
    }
}
